import { createRouter, createWebHistory } from 'vue-router'

import WantBuy from '@/views/WantBuy.vue'
import App from '@/App.vue'

import Auto from '@/views/auto.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path:'/',redirect:'/Auto'},
    {
      path: '/',
      name: 'app',
      component: App,
      redirect: '/Auto',
    // 子路由配置
      children: [
        {
          path:'/auto',
          name:'auto',
          component: Auto
        },
        {
          path: '/wantbuy',
          name: 'wantbuy',
          component: WantBuy
        }
      ]
    },
    {
      path: '/test',
      name: 'test',
      component: () => import('../views/kjs/test.vue'),
    },
  ],
})

export default router
